package org.arabidopsis.plantCyc;
import java.util.*;

public class ECdistances {
  List<Double> list = new ArrayList<Double>();
  Double distSum=0.0; 
  int distCount=0;
  
  public void addEntry(Double newScore)
  {
	  this.list.add(newScore);
	  distSum+=newScore;
	  distCount++;
  }

  public Double getAverage()
  {
	return distSum/distCount;
  }
  
  private void printCollection(){
    Iterator<Double> i = list.iterator();
    while(i.hasNext()) {
      System.out.println("Item: "+i.next());
    }
    System.out.println("Average: "+getAverage());
  }

  public static void main(String argv[]) {
    ECdistances e = new ECdistances();
    e.addEntry(3.1);
    e.addEntry(2.1);
    e.printCollection();
  }
}